home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / emcs1857 / 1857el~1.zoo / lisp / terminal.elc < prev    next >
Encoding:
Text File  |  1992-02-04  |  23.2 KB  |  306 lines

  1.  
  2. (provide (quote terminal))
  3.  
  4. (require (quote ehelp))
  5.  
  6. (defvar terminal-escape-char 30 "\
  7. *All characters except for this are passed verbatim through the
  8. terminal-emulator.  This character acts as a prefix for commands
  9. to the emulator program itself.  Type this character twice to send
  10. it through the emulator.  Type ? after typing it for a list of
  11. possible commands.
  12. This variable is local to each terminal-emulator buffer.")
  13.  
  14. (defvar terminal-scrolling t "\
  15. *If non-nil, the terminal-emulator will `scroll' when output occurs
  16. past the bottom of the screen.  If nil, output will `wrap' to the top
  17. of the screen.
  18. This variable is local to each terminal-emulator buffer.")
  19.  
  20. (defvar terminal-more-processing t "\
  21. *If non-nil, do more-processing.
  22. This variable is local to each terminal-emulator buffer.")
  23.  
  24. (defvar terminal-redisplay-interval 5000 "\
  25. *Maximum number of characters which will be processed by the
  26. terminal-emulator before a screen redisplay is forced.
  27. Set this to a large value for greater throughput,
  28. set it smaller for more frequent updates but overall slower
  29. performance.")
  30.  
  31. (defvar terminal-more-break-insertion "*** More break -- Press space to continue ***")
  32.  
  33. (defvar terminal-escape-map nil)
  34.  
  35. (defvar terminal-map nil)
  36.  
  37. (defvar terminal-more-break-map nil)
  38.  
  39. (if terminal-map nil (let ((map (make-keymap))) (fillarray map (quote te-pass-through)) (setq terminal-map map)))
  40.  
  41. (if terminal-escape-map nil (let ((map (make-keymap))) (fillarray map (quote undefined)) (let ((s "0")) (while (<= (aref s 0) 57) (define-key map s (quote digit-argument)) (aset s 0 (1+ (aref s 0))))) (define-key map "b" (quote switch-to-buffer)) (define-key map "o" (quote other-window)) (define-key map "e" (quote te-set-escape-char)) (define-key map " " (quote redraw-display)) (define-key map "" (quote te-flush-pending-output)) (define-key map "m" (quote te-toggle-more-processing)) (define-key map "x" (quote te-escape-extended-command)) (define-key map "?" (quote te-escape-help)) (define-key map (char-to-string help-char) (quote te-escape-help)) (setq terminal-escape-map map)))
  42.  
  43. (defvar te-escape-command-alist nil)
  44.  
  45. (if te-escape-command-alist nil (setq te-escape-command-alist (quote (("Set Escape Character" . te-set-escape-char) ("Refresh" . redraw-display) ("Record Output" . te-set-output-log) ("Photo" . te-set-output-log) ("Tofu" . te-tofu) ("Stuff Input" . te-stuff-string) ("Flush Pending Output" . te-flush-pending-output) ("Enable More Processing" . te-enable-more-processing) ("Disable More Processing" . te-disable-more-processing) ("Scroll at end of page" . te-do-scrolling) ("Wrap at end of page" . te-do-wrapping) ("Switch To Buffer" . switch-to-buffer) ("Other Window" . other-window) ("Kill Buffer" . kill-buffer) ("Help" . te-escape-help) ("Set Redisplay Interval" . te-set-redisplay-interval)))))
  46.  
  47. (if terminal-more-break-map nil (let ((map (make-keymap))) (fillarray map (quote te-more-break-unread)) (define-key map (char-to-string help-char) (quote te-more-break-help)) (define-key map " " (quote te-more-break-resume)) (define-key map " " (quote redraw-display)) (define-key map "" (quote te-more-break-flush-pending-output)) (define-key map "
  48. " (quote te-more-break-advance-one-line)) (setq terminal-more-break-map map)))
  49.  
  50. (defun te-escape nil (interactive) (byte-code "וêוז ח ə⑨⑧טÄי♪!êכ♪!êל â\"מנס !\"é#ע!ë⓪)êפצ!êק✓רש
  51. \"\"âC
  52. ë⑥╱êתן )éOך♪✓\"ë⓪àOם✓!+ç" [s local global terminal-escape-map prefix-arg terminal-escape-char last-command-char nil current-local-map current-global-map ((byte-code "א✓!êב    !ç" [global local use-global-map use-local-map] 3)) use-global-map use-local-map read-key-sequence format "Emacs Terminal escape> %d " prefix-numeric-value "Emacs Terminal escape> " message "" string= make-string 1 -259 te-pass-through lookup-key call-interactively] 14))
  53.  
  54. (defun te-escape-help nil "\
  55. Provide help on commands available after terminal-escape-char is typed." (interactive) (byte-code "אêבג!êד    !⑧הו!)ç" [char terminal-escape-char nil message "Terminal emulator escape help..." single-key-description with-electric-help (lambda nil (byte-code "וזח✓✓✓✓%!êוטי!!êוזכלמ    א#מ#!êנס!â+סע !פ\"é1צע !ק\"♪àoר♪@A!å?שתן
  56. \"àO
  57. ךםך!Oë⑤êוף!êו♪@@!êוץ!êו
  58. !ê§∧!)ê♪Aë③êé2)êהç" [char terminal-escape-map t l te-escape-command-alist doc nil princ format "Terminal-emulator escape, invoked by \"%s\"
  59. Type \"%s\" twice to send a single \"%s\" through.
  60.  
  61. Other chars following \"%s\" are interpreted as follows:
  62. " substitute-command-keys "\\{terminal-escape-map}
  63. " "
  64. Subcommands of \"%s\" (%s)
  65. " where-is-internal te-escape-extended-command fboundp sortcar copy-sequence string< sort (lambda (a b) (byte-code "א✓@    @\"ç" [a b string<] 3)) documentation "Not documented" string-match "
  66. " 0 match-beginning "  \"" "\":
  67.      " write-char 10] 23))] 4))
  68.  
  69. (defun te-escape-extended-command nil (interactive) (byte-code "גêא⑨דה♪גא$)⑧✓à③וזì)ç" [c completion-ignore-case t te-escape-command-alist nil completing-read "terminal command: " foo (byte-code "ב✓!ë⓪ê
  70. ⑨    à*ג✓ב    @@!\"â\"דהו    @A!\"é&    Aë①êé✓)ç" [c l te-escape-command-alist downcase string= throw foo call-interactively] 8)] 5))
  71.  
  72. (defun te-escape-extended-command-unread nil (interactive) (byte-code "אê    ë⓪êב ç" [unread-command-char last-input-char nil te-escape-extended-command] 2))
  73.  
  74. (defun te-set-escape-char (c) "\
  75. Change the terminal-emulator escape character." (interactive "cSet escape character to: ") (byte-code "בê    ⑧ג✓
  76. Uâדé⓪הו
  77. !ו✓!#ê
  78. ë①)ç" [o terminal-escape-char c nil message "\"%s\" is escape char" "\"%s\" is now escape; \"%s\" passes though" single-key-description] 6))
  79.  
  80. (defun te-stuff-string (string) "\
  81. Read a string to send to through the terminal emulator
  82. as though that string had been typed on the keyboard.
  83.  
  84. Very poor man's file transfer protocol." (interactive "sStuff string: ") (byte-code "אêב✓    \"ç" [te-process string nil process-send-string] 3))
  85.  
  86. (defun te-set-output-log (name) "\
  87. Record output from the terminal emulator in a buffer." (interactive (byte-code "✓â✓IJé②אבגדהp!\"IJ#Cç" [te-log-buffer nil read-buffer "Record output in buffer: " format "%s output-log" buffer-name] 6)) (byte-code "IJê
  88. ?å♪ב
  89. ג\"â⑧IJë⓪êדה!é?ו
  90. !â\"IJé2èז
  91. !qêח êטp!êי )êו
  92. !ë⓪êדכל✓!\"ç" [te-log-buffer nil name equal "" message "Output logging off." get-buffer get-buffer-create fundamental-mode buffer-flush-undo erase-buffer "Recording terminal emulator output into buffer \"%s\"" buffer-name] 12))
  93.  
  94. (defun te-tofu nil "\
  95. Discontinue output log." (interactive) (byte-code "ijêIJij!ç" [nil te-set-output-log] 2))
  96.  
  97. (defun te-toggle (sym arg) (byte-code "✓ג    !?â     é#    דUâ⑧✓J?é#    הWâ\"אé#בLç" [sym arg nil t numberp 1 0] 4))
  98.  
  99. (defun te-toggle-more-processing (arg) (interactive "p") (byte-code "בêגדIJ✓\"âהéו!ê    à⑧זë②ç" [arg terminal-more-processing te-more-count nil message te-toggle "More processing on" "More processing off" -1] 4))
  100.  
  101. (defun te-toggle-scrolling (arg) (interactive "p") (byte-code "IJêאבג✓\"âדéה!ç" [arg nil message te-toggle terminal-scrolling "Scroll at end of page" "Wrap at end of page"] 4))
  102.  
  103. (defun te-enable-more-processing nil "\
  104. Enable ** MORE ** processing" (interactive) (byte-code "IJêאij!ç" [t nil te-toggle-more-processing] 2))
  105.  
  106. (defun te-disable-more-processing nil "\
  107. Disable ** MORE ** processing" (interactive) (byte-code "ijêIJij!ç" [nil te-toggle-more-processing] 2))
  108.  
  109. (defun te-do-scrolling nil "\
  110. Scroll at end of page (yuck)" (interactive) (byte-code "IJêאij!ç" [t nil te-toggle-scrolling] 2))
  111.  
  112. (defun te-do-wrapping nil "\
  113. Wrap to top of window at end of page" (interactive) (byte-code "ijêIJij!ç" [nil te-toggle-scrolling] 2))
  114.  
  115. (defun te-set-redisplay-interval (arg) "\
  116. Set the maximum interval (in output characters) between screen updates.
  117. Set this number to large value for greater throughput,
  118. set it smaller for more frequent updates (but overall slower performance." (interactive "NMax number of output chars between redisplay updates: ") (byte-code "בê✓ג]ë⓪ê✓①דë②ç" [arg terminal-redisplay-interval te-redisplay-count nil 1 0] 2))
  119.  
  120. (put (quote te-more-break-unread) (quote suppress-keymap) t)
  121.  
  122. (defun te-more-break-unread nil (interactive) (byte-code "גê✓    Uâדה!é#וזח✓!ט #êיë②êכ êגל )ç" [last-input-char terminal-escape-char te-more-count terminal-more-processing nil call-interactively te-escape message "Continuing from more break (\"%s\" typed, %d chars output pending...)" single-key-description te-pending-output-length 259259 te-more-break-unwind te-pass-through] 7))
  123.  
  124. (defun te-more-break-resume nil "\
  125. Proceed past the **MORE** break,
  126. allowing the next page of output to appear" (interactive) (byte-code "ijêIJא!êב ç" [nil message "Continuing from more break" te-more-break-unwind] 3))
  127.  
  128. (defun te-more-break-help nil "\
  129. Provide help on commands available in a terminal-emulator **MORE** break" (interactive) (byte-code "ijêIJא!êבג!êדה!ç" [nil message "Terminal-emulator more break help..." sit-for 0 with-electric-help (lambda nil (byte-code "בג!êבדהוז✓IJ#חז!#!êבטי!!êבכ!êאç" [terminal-more-break-map t nil princ "Terminal-emulator more break.
  130.  
  131. " format "Type \"%s\" (te-more-break-resume)
  132. %s
  133. " where-is-internal te-more-break-resume documentation substitute-command-keys "\\{terminal-more-break-map}
  134. " "Any other key is passed through to the program
  135. running under the terminal emulator and disables more processing until
  136. all pending output has been dealt with."] 9))] 4))
  137.  
  138. (defun te-more-break-advance-one-line nil "\
  139. Allow one more line of text to be output before doing another more break." (interactive) (byte-code "IJêאë⓪êב ç" [te-more-count nil 1 te-more-break-unwind] 2))
  140.  
  141. (defun te-more-break-flush-pending-output nil "\
  142. Discard any output which has been received by the terminal emulator but
  143. not yet proceesed and then proceed from the more break." (interactive) (byte-code "ijêIJ êא ç" [nil te-more-break-unwind te-flush-pending-output] 3))
  144.  
  145. (defun te-flush-pending-output nil "\
  146. Discard any as-yet-unprocessed output which has been received by
  147. the terminal emulator." (interactive) (byte-code "אê✓A?âבג!é*ד ⑨בה    \"êוזח    \"Dë⓪êט êיא!êכו!)ç" [te-pending-output length nil message "(There is no output pending)" te-pending-output-length "Flushing %d chars of pending output" 0 format "
  148. *** %d chars of pending output flushed ***
  149. " te-update-pending-output-display te-process-output sit-for] 8))
  150.  
  151. (defun te-pass-through nil "\
  152. Send the last character typed through the terminal-emulator
  153. without any interpretation" (interactive) (byte-code "גê✓    =âוז!é'
  154. à♪A?àחג!êט
  155. יכ✓\"\"êלה!ç" [last-input-char terminal-escape-char terminal-more-processing te-pending-output nil te-process t call-interactively te-escape te-set-more-count send-string make-string 1 te-process-output] 7))
  156.  
  157. (defun te-set-window-start nil (byte-code "דp!⑧✓à♪ה✓!⑨✓?å@    ו`eZ
  158. T\"Yâ$ז✓e\"é@    וd`Z
  159. T\"Yâ?ז✓חdט    
  160. T\"י#\"é@ג*ç" [w h te-width t nil get-buffer-window window-height / set-window-start - * -1] 12))
  161.  
  162. (defun te-pending-output-length nil (byte-code "    @    Aə⑧
  163. à⑧✓
  164. @G\\⓪
  165. Aë②êé╱ê✓*ç" [length te-pending-output tem] 3))
  166.  
  167. (defun te-more-break nil (byte-code "יij!êכIJ!ê`ë①êכא!êל ë②êמ♪!êכג!êנ
  168. !ë④êכה!ê◆⑥╱ס✓עEë⑥◆êפ
  169. צ\"êק êרש !p=àHתן!êmåd    ?ådèךם!êף``
  170. \\\"ê    c)êץ§!ê∧∞!êαβij\"ç" [t te-more-old-point te-more-old-local-map terminal-more-break-map te-more-old-filter te-process te-more-old-mode-line-format mode-line-format mode-line-buffer-identification terminal-more-break-insertion te-width te-set-more-count make-local-variable current-local-map use-local-map process-filter "--   **MORE**  " "%-" set-process-filter (lambda (process string) (byte-code "èב✓!qêג    
  171. C\"ë①)êד ç" [process te-pending-output string process-buffer nconc te-update-pending-output-display] 4)) te-update-pending-output-display window-buffer selected-window message "More break " forward-char 1 delete-region run-hooks terminal-more-break-hook sit-for 0 throw te-process-output] 20))
  172.  
  173. (defun te-more-break-unwind nil (byte-code "כ✓!êל    
  174. \"ê♪bê
  175. ë④êמנ !êו╱må6✓à6סע!êפ``✓G\\\"êצק    \"ê♪bêוë③êר
  176. ש ))êתי!ç" [te-more-old-local-map te-process te-more-old-filter te-more-old-point mode-line-format te-more-old-mode-line-format buffer-read-only nil terminal-more-break-insertion te-width te-more-count t use-local-map set-process-filter set-buffer-modified-p buffer-modified-p forward-char 1 delete-region insert-char 32 259259 te-newline te-process-output] 10))
  177.  
  178. (defun te-set-more-count (newline) (byte-code "ה`eZ    T\"⑧
  179. à⓪✓Të⓪ê✓♪Uâ♪ë④éR✓♪SUâ*♪ë④éR✓ה♪ו\"Wå8♪✓ZזVâC♪✓Zë④éR♪♪זVâNוéOחZë④)ç" [line te-width newline te-height te-more-count t / 2 10 1] 5))
  180.  
  181. (defun te-newline nil "\
  182. Move down a line, optionally do more processing, perhaps wrap/scroll,
  183. move to start of new line, clear to end of line." (byte-code "ד ê✓?å    Së①הWâ⑦וא!é    ה=àז êmâ>חee♪\\\"êebê à;טי!êdbêכcéHלי!êח``♪\\\"êמנ♪\"êס êע ç" [terminal-more-processing te-more-count t te-width terminal-scrolling end-of-line 0 te-set-more-count te-more-break delete-region delete-char 1 10 forward-char insert-char 32 beginning-of-line te-set-window-start] 11))
  184.  
  185. (defun te-down-vertically-or-scroll nil "\
  186. Move down a line vertically, or scroll at bottom." (byte-code "i⑧א êmâ'בee    \\\"êebêגד!êdbêהcêוז    \"êח é*טד!êי✓!)êכ ç" [column te-width end-of-line delete-region delete-char 1 10 insert-char 32 beginning-of-line forward-line move-to-column te-set-window-start] 9))
  187.  
  188. (defun te-move-to-position nil (byte-code "ה וZה וZ⑨⑧    
  189. Vå③✓♪Vâəגé$זe    ח✓
  190. T\"#b*êטë⑤ç" [y x te-width te-height nil te-more-count te-get-char 32 + * -1] 8))
  191.  
  192. (defun te-clear-rest-of-line nil (byte-code "è`IJ ê`Z⑧א``✓\\\"êבג✓[\"))ç" [n end-of-line delete-region insert-char 32] 5))
  193.  
  194. (defun te-clear-rest-of-screen nil (byte-code "èIJ êא êm?à\"בג!êא êד`✓Z`\"êהו✓\"êé⇦)ç" [te-width te-clear-rest-of-line end-of-line forward-char 1 delete-region insert-char 32] 9))
  195.  
  196. (defun te-clear-screen nil (byte-code "ג êד⑧✓    Wà✓Të⓪êהו
  197. \"êזcêé❎)êחdSd\"êebêטë③ç" [i te-height te-width te-more-count erase-buffer 0 insert-char 32 10 delete-region -1] 5))
  198.  
  199. (defun te-insert-lines nil (byte-code "n?â    ijéQèו
  200. ז`eZ♪T\"ח#⑨ט יZ    ^כלdמ ♪T\"Zd\"ê`d=à2נcê
  201. WàO
  202. Të⑤êסי♪\"ê
  203.     =åKנcêé3+)êחë⑥╱ç" [nil line te-height te-width n i te-more-count - / -1 te-get-char 32 0 delete-region * 10 insert-char] 9))
  204.  
  205. (defun te-delete-lines nil (byte-code "n?â    ijéMו
  206. ז`eZ♪T\"ח#⑨ט יZ    ^כל``מ ♪T\"\\d^\"êèdbê
  207. WàK
  208. Të⑤êני♪\"ê
  209.     =åGסcêé/)+êחë⑥╱ç" [nil line te-height te-width n i te-more-count - / -1 te-get-char 32 0 delete-region * insert-char 10] 9))
  210.  
  211. (defun te-beginning-of-line nil (byte-code "ij ç" [beginning-of-line] 2))
  212.  
  213. (defun te-backward-char nil (byte-code "n?à✓ijIJ!ç" [backward-char 1] 2))
  214.  
  215. (defun te-forward-char nil (byte-code "l?à✓ijIJ!ç" [forward-char 1] 2))
  216.  
  217. (defun te-delete nil (byte-code "nâ✓ijé④IJ`S`\"êאcêבג!ç" [nil delete-region 32 forward-char -1] 3))
  218.  
  219. (defun te-beep nil (byte-code "ij ç" [beep] 2))
  220.  
  221. (defun te-insert-spaces nil (byte-code "`⑧ב גZד ê`✓Z^⑨    הXâ⑧אé$ו    [!ê✓bêזג    \"ê✓b*ç" [p n nil te-get-char 32 end-of-line 0 delete-char insert-char] 6))
  222.  
  223. (defun te-delete-char nil (byte-code "`⑧ב גZד ê`✓Z^⑨    הXâ⑧אé#וג    \"ê✓bêז    !ê✓b*ç" [p n nil te-get-char 32 end-of-line 0 insert-char delete-char] 5))
  224.  
  225. (defun te-losing-unix nil (byte-code "ijç" [nil] 1))
  226.  
  227. (defun te-output-tab nil (byte-code "`⑧✓ב ê`Z⑨גד    ה\"Zו ê`✓Z^ə✓
  228. \\b+ç" [p x l beginning-of-line 8 logand 7 end-of-line] 6))
  229.  
  230. (defun te-filter (process string) (byte-code "p⑧
  231. ⑨חÄט♪!qê bêי
  232. !à/כ
  233. !?â!הë⑤é/
  234. qêdbê◆cêט♪!qêל✓◆C\"ë⑥✓êמ ê    əנpסע !=!)êט♪!qê`ë④)*ç" [obuf m meta-flag process te-saved-point te-log-buffer nil string te-pending-output ((byte-code "✓qç" [obuf] 1)) process-buffer bufferp buffer-name nconc te-update-pending-output-display te-process-output window-buffer selected-window] 12))
  235.  
  236. (defun te-process-output (preemptable) (byte-code "IJë⓪êגדìêה ə
  237. ו♪!ë③=?à(ז♪!p=à$ח♪`\"êé
  238. *ç" [preemptable t s w te-process-output (byte-code "IJIJIJIJIJIJ╱ə⑧◆AàP⇧
  239. ③◆@④◆A@②
  240. Hë⑤ê Të④
  241. G=âDי◆AAB⑥◆י④◆A@ë②êכ éIל◆ \"ê
  242. מVàS
  243. נWâ⇧lâ| י=âpיסע
  244. \"◆ABBë⑥◆évל◆ S\"êפ é⑧⇧
  245. ?âÄצע!ê
  246. cêקע!é⑧⇧♪
  247. =àû╱åªרש
  248. #ë⑥╱åª
  249. G    צע!ê
  250. cê`ë⑤êת ê     `
  251. Z\\^ë⑥    ê
  252. bê    ╱=àעIJë⑥╱êן``     Z\\\"ê י=àτ    
  253. G=â∈
  254. é≤
  255.     Ocê    
  256. G=â    ⇧י◆AABë⑥◆é⇧ל◆    \"êק     ZT!)é=⇧ך
  257. ם=â/⇧ףץ §\"Aå,⇧∧é8⇧ף
  258. ∞\"Aå8⇧∧!êקע!ê
  259. àL⇧α àL⇧βΓז\"êé
  260. .╱ç" [buffer-read-only nil string ostring start char matchpos te-pending-output t end preemptable 0 te-update-pending-output-display setcar 31 255 make-string 1 te-newline delete-char te-redisplay-if-necessary string-match "[--¯]" end-of-line delete-region funcall 16 assq te-get-char ((61 . te-move-to-position) (99 . te-clear-rest-of-line) (67 . te-clear-rest-of-screen) (15 . te-insert-lines) (11 . te-delete-lines) (1 . te-beginning-of-line) (2 . te-backward-char) (100 . te-delete-char) (95 . te-insert-spaces) (6 . te-forward-char) (7 . te-beep) (10 . te-down-vertically-or-scroll) (12 . te-clear-screen)) te-losing-unix ((10 . te-newline) (127 . te-delete) (13 . te-beginning-of-line) (7 . te-beep) (8 . te-backward-char) (9 . te-output-tab)) input-pending-p throw te-process-output] 23) selected-window next-window window-buffer set-window-point] 7))
  261.  
  262. (defun te-get-char nil (byte-code "✓Aâ,✓@✓A@ə⑨
  263.     H    Të①
  264. G=â#ב✓AABë⓪é'ג✓    \"ê*é/דהìç" [te-pending-output start string 0 setcar char (byte-code "א    !⑧בÄג    ד\"êה    !))ç" [filter te-process process-filter ((byte-code "א✓    \"ç" [te-process filter set-process-filter] 3)) set-process-filter (lambda (p s) (byte-code "✓Gא=å א✓Dë①êבג✓דH\"ç" [s te-pending-output 1 throw char 0] 4)) accept-process-output] 4)] 4))
  265.  
  266. (defun te-redisplay-if-necessary (length) (byte-code "✓    Zë⓪בXà\"pגד !=à\"ה à\"ו êזב!ê
  267. ë⓪ç" [te-redisplay-count length terminal-redisplay-interval 0 window-buffer selected-window waiting-for-user-input-p te-update-pending-output-display sit-for] 7))
  268.  
  269. (defun te-update-pending-output-display nil (byte-code "✓A?â בë①é'ג ə
  270. דWâבë①é&הוז
  271. ח\\ט\"\"ë①)êיכ !ç" [te-pending-output te-pending-output-info length "" te-pending-output-length 1500 format "(%dK chars output pending) " / 512 1024 set-buffer-modified-p buffer-modified-p] 6))
  272.  
  273. (defun te-sentinel (process message) (byte-code "ה✓!ו=åDזח✓!!?åDpəèח✓!qêגë③êט êdbêי êכ êלמ
  274. נ#)ê
  275. ח✓!=à:ס àCdbêעפ!)ç" [process t b buffer-read-only nil message process-status run buffer-name process-buffer fundamental-mode delete-blank-lines delete-horizontal-space insert "
  276. *******
  277. " "*******
  278. " waiting-for-user-input-p recenter -1] 12))
  279.  
  280. (defvar te-stty-string "stty -nl new dec echo" "\
  281. Command string (to be interpreted by \"sh\") which sets the modes
  282. of the virtual terminal to be appropriate for interactive use.")
  283.  
  284. (defvar explicit-shell-file-name nil "\
  285. *If non-nil, is file name to use for explicitly requested inferior shell.")
  286.  
  287. (defun terminal-emulator (buffer program args &optional width height) "\
  288. Under a display-terminal emulator in BUFFER, run PROGRAM on arguments ARGS.
  289. ARGS is a list of argument-strings.  Remaining arguments are WIDTH and HEIGHT.
  290. BUFFER's contents are made an image of the display generated by that program,
  291. and any input typed when BUFFER is the current Emacs buffer is sent to that
  292. program an keyboard input.
  293.  
  294. Interactively, BUFFER defaults to \"*terminal*\" and PROGRAM and ARGS
  295. are parsed from an input-string using your usual shell.
  296. WIDTH and HEIGHT are determined from the size of the current window
  297. -- WIDTH will be one less than the window's width, HEIGHT will be its height.
  298.  
  299. To switch buffers and leave the emulator, or to give commands
  300. to the emulator itself (as opposed to the program running under it),
  301. type Control-^.  The following character is an emulator command.
  302. Type Control-^ twice to send it to the subprogram.
  303. This escape character may be changed using the variable `terminal-escape-char'.
  304.  
  305. `Meta' characters may not currently be sent through the terminal emulator.
  306.  
  307. Here is a list of some of the variables which control the behaviour
  308. of the emulator -- see their documentation for more information:
  309. terminal-escape-char, terminal-scrolling, terminal-more-processing,
  310. terminal-redisplay-interval.
  311.  
  312. This function calls the value of terminal-mode-hook if that exists
  313. and is non-nil after the terminal buffer has been set up and the
  314. subprocess started.
  315.  
  316. Presently with `termcap' only; if somebody sends us code to make this
  317. work with `terminfo' we will try to use it." (interactive (byte-code "èגד!qêהוij!?å⑨✓?å⑨ז✓!ח=?â pé#טד!!)י
  318. å7כל!å7כמ!å7נ⑨סעפ    \"!צ♪ק\"âL    רDéOש♪!*!Bç" [te-process default-s explicit-shell-file-name s get-buffer-create "*terminal*" buffer-name boundp process-status run generate-new-buffer append getenv "ESHELL" "SHELL" "/bin/sh" read-string format "Run program in emulator: (default %s) " equal "" nil te-parse-program-and-args] 14)) (byte-code "יêפ !ê
  319. ?à③צק !רZë⑤ê╱?à#שק !רZë⑥╱êת ê
  320. ⑥◆╱ë⑥✓êןך◆✓#םDë⑥    êי
  321. ף )êי ץp!ë⑥ àn§ן∧∞ !\"!âcα !éjβΓ∞ !\"êéG)êπΣσÅêµτ!àéΦΘ!êΩר!êΦδ∮
  322. !ϕ∮∈∩נ#≡##êנë⑥⓪ê±①!ê≥≤!ç" [te-process default-s explicit-shell-file-name s buffer width height te-width te-height mode-line-buffer-identification buffer-read-only nil process terminal-escape-char terminal-escape-map t inhibit-quit terminal-map switch-to-buffer window-width selected-window 1 window-height terminal-mode format "Emacs terminal %dx%d: %%b  " te-pending-output-info te-clear-screen get-buffer-process y-or-n-p "Kill process %s? " process-name delete-process error "Process %s not killed" err (byte-code "חטי    
  323. ♪â
  324. כéל$מנסעפצ&◆⑧קר!â:רש
  325. ╱תןךםףpץ§∧∞αBβ✓BD&
  326. ë④édΓשpπΣטσ◆µ✓τP!µΦ✓P!Θµ
  327. ╱BΩ#%%ë④êδ ם\"ê∮ §\")ç" [termcap te-width te-height terminal-scrolling te-process program args te-stty-string exec-directory concat format "emacs-virtual:co#%d:li#%d:%s" "" "ns:" "cm=^p=%+ %+ :cr=^p^a:le=^p^b:nd=^p^f:" "nw=^j:ce=^pc:cd=^pC:cl=^p^l:bl=^p^g:" "IC=^p_%+ :DC=^pd%+ :AL=^p^o%+ :DL=^p^k%+ :" "LP:NF:" "ic=^p_!:dc=^pd!:al=^p^o!:dl=^p^k!:ho=^p=  :" "im=:ei=:dm=:ed=:mi:do=^p^j:nl=^p^j:bs:" fboundp start-subprocess "terminal-emulator" channel-type terminal filter te-filter buffer sentinel te-sentinel modify-environment "TERM" "emacs-virtual" "TERMCAP" start-process "/bin/sh" "-c" "%s; exec %s TERM=emacs-virtual %s %s" te-quote-arg-for-sh "env" "TERMCAP=" mapconcat " " set-process-filter set-process-sentinel] 20) ((error (byte-code "IJ êא✓@✓A\"ç" [err fundamental-mode signal] 4))) default-value meta-flag message "Note:  Meta key disabled due to maybe-eventually-reparable braindamage" sit-for "Entering emacs terminal-emulator...  Type %s %s for help" single-key-description mapconcat where-is-internal te-escape-help " " use-local-map run-hooks terminal-mode-hook] 28))
  328.  
  329. (defun te-parse-program-and-args (s) (byte-code "הו✓\"âQאז⑨♪àAהח✓♪#â1✓♪טי!Oטז!ë③ê♪✓G=à-אë③êé9✓♪אOאë③ê    Bë①êé♪êכ    !ë①ê    @    AD*élהל✓\"à\\מ✓!?âi נס✓PDDél✓אDç" [s l nil p shell-file-name t string-match "\\`\\([a-zA-Z0-9-+=_.@/:]+[     ]*\\)+\\'" 0 "\\([a-zA-Z0-9-+=_.@/:]+\\)\\([     ]+\\)*" match-end 1 nreverse "[     ]" file-exists-p "-c" "exec "] 11))
  330.  
  331. (put (quote terminal-mode) (quote mode-class) (quote special))
  332.  
  333. (defun terminal-mode nil "\
  334. Set up variables for use f the terminal-emualtor.
  335. One should not call this -- it is an internal function
  336. of the terminal-emulator" (byte-code "פ êצp!êקë⓪êרë①êשë②êגë③êגë⑤êתה!êןה!ë⑥╱êתו!êןו!ë⑥◆êתז!êןז!ë⑥✓êתח!êןח!ë⑥    êתך!êתם!êתף!êתט!êץCë⑥
  337. êתי!êeë⑥♪êתכ!ê§ë⑥ êת∧!êתל!êמë⑥
  338. êתנ!ê∞ë⑥êתס!ê    ë⑥⓪êתע!êמë⑥①ç" [major-mode mode-name mode-line-process buffer-read-only t truncate-lines terminal-escape-char terminal-scrolling terminal-more-processing terminal-redisplay-interval te-pending-output te-saved-point te-pending-output-info te-log-buffer nil te-more-count te-redisplay-count meta-flag kill-all-local-variables buffer-flush-undo terminal-mode "terminal" (": %s") make-local-variable default-value te-width te-height te-process 0 "" inhibit-quit -1] 23))
  339.  
  340. (defun te-quote-arg-for-sh (fuckme) (byte-code "הו✓\"â♪✓é`הז✓\"?â⑨ח✓!é`טייə♪✓GYâ*דéBהכ✓♪#ë④â8IJéB
  341. ✓♪דOPë②êדàZ
  342. ✓♪ Oל✓ TOR② Të③êéêמ
  343. מQ+ç" [fuckme t harder cretin stupid nil string-match "\\`[a-zA-Z0-9-+=_.@/:]+\\'" "[$]" prin1-to-string "" 0 "[\"\\$]" "\\" "\""] 11))
  344.